package dpss.commons;

import java.io.File;
import java.io.IOException;
import java.net.InetAddress;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

public class XMLUtility {
	
	final static String CENTRAL_REPO_PATH = "resources/serverinfo.xml";
	
	public String getServerInfo(InetAddress IPAddress) throws ParserConfigurationException, SAXException, IOException{
		
		File xmlFile = new File(CENTRAL_REPO_PATH);
		DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
		DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
		Document doc = dBuilder.parse(xmlFile);
		
		NodeList nodeList = doc.getElementsByTagName("server");
		
		return null;
	}
	
	public void setServerInfo(){
		
	}

}
